{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li><a href="{php echo web_url('store/group/index')}">商户分组列表</a></li>
	<li {if empty($data['id'])}class="active"{/if}><a href="{php echo web_url('store/group/edit')}">添加商户分组</a></li>
	{if !empty($data['id'])}
	<li class="active"><a href="#">编辑商户分组</a></li>
	{/if}
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
			<input type="hidden" name="id" value="{$group['id']}" />
			<div class="panel panel-default" id="step1">
				<div class="panel-heading">商户分组</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-2 control-label">分组名称<span class="must-fill">*</span></label>
						<div class="col-sm-9">
							<input type="text" name="group[name]" required  placeholder="请输入分组名称"  autocomplete="off" class="form-control" value="{$group['name']}">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">是否默认</label>
						<div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name='isdefault' value='1' {if $group['isdefault']==1}checked{/if}>是
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name='isdefault' value='0' {if $group['isdefault']==0}checked{/if}>否
                            </label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">是否启用</label>
						<div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name='enabled' value='1' {if $group['enabled']==1}checked{/if}>是
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name='enabled' value='0' {if $group['enabled']==0}checked{/if}>否
                            </label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">商户组权限</label>
						<div class="col-sm-9">
							<label class="checkbox-inline">
								<input type="checkbox" {if in_array('goods',$group['authority'])} checked="checked" {/if} name="authority[]" value="goods" id="wk1">商品管理
							</label>
							<label class="checkbox-inline">
								<input type="checkbox" {if in_array('comment',$group['authority'])} checked="checked" {/if} name="authority[]" value="comment" id="wk6">口碑管理
							</label>
							<label class="checkbox-inline">
								<input type="checkbox" {if in_array('dynamic',$group['authority'])} checked="checked" {/if} name="authority[]" value="dynamic" id="wk8">商户动态
							</label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">付费入驻类型</label>
						<div class="col-sm-9">
							<select class="form-control" name="group[chargeid]">
								<option value="0" {if empty($group['chargeid']) ||$group['chargeid'] == 0 } selected="selected" {/if} >不匹配付费入驻类型</option>
								{loop $chargelist $charge}
								<option value="{$charge['id']}" {if $group['chargeid'] == $charge['id'] } selected="selected" {/if} >{$charge['name']}</option>
								{/loop}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">默认结算金额比</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="text" name="group[defaultrate]" class="form-control" value="{$group['defaultrate']}">
								<span class="input-group-addon">%</span>
							</div>
							<span class="help-block">商品未设置结算金额时，默认以此比例设置结算金额,请输入正整数</span>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input name="submit" type="submit" class="btn btn-primary min-width" value="保存">
					<input type="hidden" name="token" value="{$_W['token']}" />
					<input type="hidden" name="id" value="{php echo intval($_GPC['id']);}" />
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	myrequire(['layui'],function(){
		layui.use(['layer','form','laydate'], function(){
		  	var layer = layui.layer,
			form = layui.form();
		});
	});
</script>
{php include wl_template('common/footer');}